#include "stdafx.h"
#include "../../GameCore/CGame.h"
#define NUMBER_BUTTON		2
//Button _arrResult[NUMBER_BUTTON];

#define _DEC_NUMBER_BUTTON		(NUMBER_BUTTON)
#define _DEC_ARR_BUTTON			(_arrResult)
#define _DEC_ANIM_BEGIN			0

#define RESULT_BUTTON_RESTART	0
#define RESULT_BUTTON_QUIT		1
int _num_button;
void CGame::UpdateResult()
{
	if(_GameSubState==k_INIT)
	{		
		
		SetSubState(k_FIRST_TIME);
	}
	else if(_GameSubState==k_FIRST_TIME)	
	{
		SetSubState(k_LOOP);
	}
	else if (_GameSubState == k_LOOP)
	{
		if(TouchResult())
			SetGameState(k_GS_PLAYGAME,true);
	}
	else if (_GameSubState == k_DESTROY)
	{
		SetGameState(_GameStateNew, false);
	}
}
bool CGame::TouchResult()
{
	bool flag = false;
	for(int i = 0; i < GET_GAME()->_num_touches;i++)
	{
		if(!GET_TOUCH(i)->_flag)
		{
			continue;
		}
		if( GET_TOUCH(i)->_state == TOUCH_DOWN)
		{
			ClearAllTouch();
			return true;
		}
	}
	return false;
}
void CGame::RenderResult()
{
	_g->SetColor(0x000000);
	_g->FillRect(0, 0, k_SCREEN_WIDTH, k_SCREEN_HEIGHT);
}